package com.zqxq.lottery.controller.sys;

import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.common.constant.Result;
import com.zqxq.lottery.entity.bo.sys.SysAppVersionBO;
import com.zqxq.lottery.entity.vo.sys.SysAppVersionVO;
import com.zqxq.lottery.entity.vo.sys.SysBannerVO;
import com.zqxq.lottery.service.sys.ISysAppVersionService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class SysAppVersionController extends SysBaseController{

    @Autowired
    private ISysAppVersionService sysAppVersionService;

    @ApiOperation("App更新升级")
    @PostMapping("/app/upgrade")
    public Result<Page<SysBannerVO>> upgrade(@RequestBody SysAppVersionBO search){
        Result result = new Result();
        try{
            SysAppVersionVO app = sysAppVersionService.queryOne(search);
            result.setData(app);
        } catch (Exception e){
            log.error("App upgrade", e);
        }
        return result;
    }

}
